NetLogo banner

Home
Download
Help
Forum
Resources
Extensions
FAQ
NetLogo Publications
Contact Us
Donate

Models:
Library
Community
Modeling Commons

Beginners Interactive NetLogo Dictionary (BIND)
NetLogo Dictionary

User Manuals:
Web
Printable
Chinese
Czech
Farsi / Persian
Japanese
Spanish

  Donate

NetLogo User Community Models

(back to the NetLogo User Community Models)

[screen shot]

Download
If clicking does not initiate a download, try right clicking or control clicking and choosing "Save" or "Download".

Try It in NetLogo Web

## WHAT IS IT?

This is a model of bats using echolocation to catch moths. The bats chirp, producing sound waves that indicate the direction of any moths they intersect.

## HOW IT WORKS

Bats and moths are randomly distributed in the world of the model. The bats then echolocate the moths by chirping sound waves that move outward from the bat until they intersect with the nearest moth, if any. The bat turns to face the moth identified by the sound wave it generated. When bats fly into the same space as a moth, they catch and eat it. Bats ignore moths identified outside of their detection range, a cone of variable degree set by the user. They also avoid other bats that fly into their detection range. When there are no moths left, the model stops.

## HOW TO USE IT

When you press the setup button, bats and moths will be randomly distributed throughout the world of the model and the bats will be labeled with a number. Interface sliders may be used prior to setup to set the population of bats, the population of moths, the energy of the echolocation waves the bats generate, which determines the radius of each echolocation sound wave, the detection range, which is the angle in front of each bat in which detected moths will be hunted, and the angle at which bats will turn to avoid other bats. When you press go, the bats and moths fly in random order, the moths turning randomly and then moving, whereas the bats only turn before moving if their echolocation identifies a moth or they will run into another bat. Each bat hatches a sound wave that moves outward, stopping if it detects a moth or when it runs out of energy. Bats turn toward any moths their sound waves identify. To be able to see the sound waves propagate, turn the tick rate slower. The number of moths each bat has eaten is shown in the monitor.

## THINGS TO NOTICE

First, if you cannot see the sound waves the bats are generating, turn down the tick rate and they will become visible. You may also notice that moth flight is mostly random whereas the bats fly in a straight line unless they find a moth or encounter another bat. Because bats and moths cycle through their procedures in random order each turn, it is possible for a moth to escape getting eaten if it gets two moves after being identified before the bat moves again as long as its movement carries it outside the detection range of the bat.

## THINGS TO TRY

How does increasing or decreasing the number of bats, the number of moths, or both change the average number of ticks it takes for the bats to catch all of the moths? You could answer this question by conducting an experiment with the model in BehaviorSpace. You may also want to see how expanding or contracting the detection range of the bats improves or hinders their hunting ability. Likewise, you can see how increasing to decreasing the energy of the echolocation waves, which impacts how far they range from the bat that chirps them, impacts hunting effectiveness.

## EXTENDING THE MODEL

Right now, bats simply avoid other bats that are in their detection range within three patches. You could program them to avoid other bats using their echolocation. You could also add obstacles, such as trees or stalagmites or stalactites, and have the bats use their echolocation to avoid them, and have them die if they fail.

## NETLOGO FEATURES

This model uses three breeds, one of which, waves, is hatched from the bat breed, spreading out and identifying the direction of any adjacent moth all during a single tick. The model uses subtract-headings to determine whether an identified moth is within the detection range of the bat that found it, and uses in-cone to avoid other bats in the detection-range. The use of subtract-headings with respect to the moths is to more closely mimic the way that bats use their echolocation to determine whether a moth is in-cone rather than relying on background functions in NetLogo, meaning it's more like real life.

## RELATED MODELS

Flocking Model (in the model library)
Wolf Sheep Predation (in the model library)
[Doppler Effect Model] (https://ccl.northwestern.edu/netlogo/models/community/doppler_effect_model)

## CREDITS AND REFERENCES

This model was created by Lilly A. Whitney and Lawrence A. Whitney.

We were aided in understanding bats and echolocation by reading an article on [How Stuff Works] (https://animals.howstuffworks.com/mammals/bat.htm) and by visiting an exhibit on bats at the Peabody Essex Museum in Salem, Massachusetts. This model is available on Netlogo User Community Models.

## LICENSE

Attribution should be made to Lilly A. Whitney and Lawrence A. Whitney.
This work is licensed under [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/?ref=chooser-v1)
![CC BY-NC-SA 3.0](http://ccl.northwestern.edu/images/creativecommons/byncsa.png)

(back to the NetLogo User Community Models)